My Profile_


Connection

There are some common steps for every transaction that is processed.

  1. Instantiate the transaction object (such as Preauthorization), and update it with object definitions that refer to the individual transaction.
  2. Instantiate the HttpsPostRequest connection object and update it with connection information, host information and the transaction object that you created in step 1. The HttpsPostRequest object and its mandatory variables apply to every transaction request.
  3. Invoke the HttpsPostRequest object's send() method.
  4. Instantiate the Receipt object, by invoking the HttpsPostRequest object's getReceipt() method. Use this object to retrieve the applicable response details.

Some transactions may require steps in addition to the ones listed here.

For an example of the full steps for each transaction, please refer to the individual transactions on this site.

HttpPostRequest Object

HttpsPostRequest mpgReq = new HttpsPostRequest();

HttpsPostRequest object mandatory values

Value Type Limits Set method Description
Processing country code String 2-character alphabetic mpgReq.setProcCountryCode(processing_country_code); CA for Canada.
Test mode Boolean true/false mpgReq.setTestMode(true); Set to true when in test mode. Set to false (or comment out entire line) when in production mode.
Store ID String 10-character alphanumeric mpgReq.setStoreId(store_id); Unique identifier provided by Moneris upon merchant account set up.
API Token String 20-character alphanumeric mpgReq.setApiToken(api_token); Unique alphanumeric string assigned upon merchant account activation. To locate your production API token, refer to the Merchant Resource Centre Admin Store Settings. The Merchant Resource Centre may be located at the following URL.
Transaction Object   mpgReq.setTransaction(transaction); Sets the transaction object that is to be processed.